import numpy as np
# 创建向量
arr1 = np.arange(10)
print(arr1) # [0 1 2 3 4 5 6 7 8 9]
# 翻转向量
arr2 = np.flipud(arr1)
print(arr2) # [9 8 7 6 5 4 3 2 1 0]

# 创建矩阵
arr2 = np.arange(1,21).reshape(4,5)
print(arr2)
"""
[[ 1  2  3  4  5]
 [ 6  7  8  9 10]
 [11 12 13 14 15]
 [16 17 18 19 20]]
"""
# 左右翻转
print(np.fliplr(arr2))
"""
[[ 5  4  3  2  1]
 [10  9  8  7  6]
 [15 14 13 12 11]
 [20 19 18 17 16]]
"""
# 上下翻转
print(np.flipud(arr2))
"""
[[16 17 18 19 20]
 [11 12 13 14 15]
 [ 6  7  8  9 10]
 [ 1  2  3  4  5]]
"""
